/* 路由懒加载 */
/* 首屏 */
const Layout = () =>
  import(/* webpackChunkName: "group-home" */ "@/views/Layout.vue");
const HomePage = () =>
  import(/* webpackChunkName: "group-home" */ "@/views/home/HomePage.vue");
const PersonalRecom = () =>
  import(
    /* webpackChunkName: "group-home" */ "@/views/home/homepageview/PersonalRecom.vue"
  );
/* 登录 和 404*/
const Login = () =>
  import(/* webpackChunkName: "group-login" */ "@/views/Login.vue");
const Register = () =>
  import(/* webpackChunkName: "group-login" */ "@/views/Register.vue");
const NotFound = () =>
  import(/* webpackChunkName: "group-login" */ "@/views/NotFound.vue");
/* 发现页其他 */
const PlayList = () =>
  import(
    /* webpackChunkName: "group-homepage" */ "@/views/home/homepageview/PlayList.vue"
  );

/* 需登录后才能进入的页面 */
const UserEdit = () =>
  import(/* webpackChunkName: "group-user" */ "@/views/user/UserEdit.vue");
const PlayListEdit = () =>
  import(
    /* webpackChunkName: "group-user" */ "@/views/playlist/PlayListEdit.vue"
  );

/* 历史播放 */
const HistoryPlay = () =>
  import(
    /* webpackChunkName: "group-hisplay" */ "@/views/historyplay/HistoryPlay.vue"
  );

/* 各大详情页 */
const PlayListDetail = () =>
  import(
    /* webpackChunkName: "group-detail" */ "@/views/playlist/PlayListDetail.vue"
  );
const UserDetail = () =>
  import(/* webpackChunkName: "group-detail" */ "@/views/user/UserDetail.vue");

const OtherUserDetail=()=>import("@/views/user/OtherUserDetail.vue")

const AllMusicList = () =>
  import(
    /* webpackChunkName: "group-detail" */ "@/views/playlist/AllMusicList.vue"
  );
/* 皮肤界面 */
const Skin=()=>import("@/views/skin/Theme.vue");
/* 皮肤推荐界面 */
const Recommend=()=>import('@/views/skin/select/Recommend.vue')
/* 皮肤自定义界面 */
const Customer=()=>import("@/views/skin/select/Customer.vue")
/* 皮肤纯色界面 */
const Pure=()=>import("@/views/skin/select/Pure.vue")
/* 皮肤其他界面 */
const Others=()=>import("@/views/skin/select/Others.vue")
const routes = [
  {
    path: "/",
    component: Layout,
    redirect: "homepage",
    children: [
      /* 发现音乐页 */
      {
        path: "homepage",
        component: HomePage,
        redirect: "/personalrecom",
        children: [
          {
            path: "/personalrecom",
            component: PersonalRecom,
            meta: { title: "个性推荐" },
          }, //个性推荐
          {//TODO:这个地方得去完善一下！！！
            path: "/playlist",
            component: PlayList,
            meta: { title: "歌单列表" },
          }, //发现页其他
        ],
      },
      {
        path: "allmusiclist",
        component: AllMusicList,
        props: true,
        meta: { title: "小雨云听精选歌单" },
      },
      {
        path: "playlistdetail/:id",
        component: PlayListDetail,
        props: true,
        meta: { title: "歌单" },
      }, //歌单详情页
      {
        path: "playlistedit/:id",
        component: PlayListEdit,
        props: true,
        meta: { check: true, title: "编辑歌单" },
      }, //歌单编辑页
      {
        path: "userdetail",
        component: UserDetail,
        props: true,
        meta: { title: "用户主页" },
      }, //用户详情页
      {
        path:'userdetail/:uuid',
        component:OtherUserDetail,
      },//其他用户详情页
      {
        path: "useredit",
        component: UserEdit,
        meta: { check: true, title: "编辑个人信息" },
      }, //用户编辑页
      {
        path: "historyplay",
        component: HistoryPlay,
        meta: { title: "最近播放" },
      }, //最近播放页
      {
        path:"skin",
        component:Skin,
        redirect:'/skin/tuijian',
        meta:{title:"自定义主题"},
        children: [
          {
            path:'tuijian',
            component:Recommend
          },
          {
            path:'star',
            component:Recommend
          },
          {
            path:'others',
            component:Others
          },
          {
            path:'pure',
            component:Pure
          },
          {
            path:'customer',
            component:Customer
          },
        ]
      }
    ],
  },
  { path: "/login", component: Login, meta: { check: false, title: "登录" } }, //登录
  {
    path: "/register",
    component: Register,
    meta: { check: false, title: "注册" },
  }, //注册
  { path: "*", component: NotFound, meta: { title: "NotFound" } }, //404
  //path: "*" 表示匹配所有未匹配到其他路由的路径
];

export default routes;
